import React from "react";
import LifeCycle from "./LifeCycle"

class App extends React.Component {
  constructor() {
    super()

    this.state = {
      isShow: true
    }
  }

  switchShow() {
    this.setState({
      isShow: !this.state.isShow
    })
  }

  render() {
    return (
      <div>
        <button onClick={() => this.switchShow()}>切换</button>
        {this.state.isShow && <LifeCycle />}
      </div>
    )
  }
}

export default App